package com.yilin.tms.core.entity.system.handle;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.annotation.Explain;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统操作日志表
 */
@Document("operate_log")
public class OperateLog implements Serializable {
    /**
     * 消息类型
     */
    public enum DeviceType {
        web(0, "WEB端"),
        mobile(1, "移动端"),
        applet(2, "小程序端");

        @EnumValue
        public Integer index;
        public String name;

        DeviceType(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    @Id
    @Explain("ID")
    private String id;
    //标题
    @Explain("接口描述")
    private String operateDescribe;//接口描述
    @Explain("操作地址")
    private String operateSite;//操作地址
    //所属平台
    @Explain("直属上级平台ID")
    private String superiorPlatId;
    //操作人
    @Explain("操作人")
    private String optUserId;
    @Explain("操作人名称")
    private String optUserName;
    @Explain("操作人TOKEN")
    private String optToken;
    @Explain("操作人IP")
    private String optIp;
    @Explain("操作人设备")
    private DeviceType optDeviceType;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Explain("操作时间")
    private Date optTime = new Date();


    public DeviceType getOptDeviceType() {
        return optDeviceType;
    }

    public void setOptDeviceType(DeviceType optDeviceType) {
        this.optDeviceType = optDeviceType;
    }

    public String getSuperiorPlatId() {
        return superiorPlatId;
    }

    public String getOptIp() {
        return optIp;
    }

    public void setOptIp(String optIp) {
        this.optIp = optIp;
    }

    public void setSuperiorPlatId(String superiorPlatId) {
        this.superiorPlatId = superiorPlatId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOptToken() {
        return optToken;
    }

    public void setOptToken(String optToken) {
        this.optToken = optToken;
    }

    public String getOperateDescribe() {
        return operateDescribe;
    }

    public void setOperateDescribe(String operateDescribe) {
        this.operateDescribe = operateDescribe;
    }

    public String getOperateSite() {
        return operateSite;
    }

    public void setOperateSite(String operateSite) {
        this.operateSite = operateSite;
    }

    public String getOptUserId() {
        return optUserId;
    }

    public void setOptUserId(String optUserId) {
        this.optUserId = optUserId;
    }

    public String getOptUserName() {
        return optUserName;
    }

    public void setOptUserName(String optUserName) {
        this.optUserName = optUserName;
    }

    public Date getOptTime() {
        return optTime;
    }

    public void setOptTime(Date optTime) {
        this.optTime = optTime;
    }
}
